Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gh-actions-language-server #3551

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

disrupted
Copy link
Contributor


name: Pull Request
about: Submit a pull request
title: 'add GitHub Actions language server'

Closes #2737

@disrupted disrupted force-pushed the feat/gh-actions-language-server branch from ccad423 to 40699fa Compare January 9, 2025 11:12
@disrupted disrupted marked this pull request as ready for review January 9, 2025 11:14
@disrupted disrupted requested a review from glepnir as a code owner January 9, 2025 11:14
@comatory

This comment was marked as resolved.

@comatory

This comment was marked as resolved.

@disrupted disrupted force-pushed the feat/gh-actions-language-server branch 2 times, most recently from d089a02 to f13ecb9 Compare January 9, 2025 14:14
@disrupted disrupted changed the title feat: add GitHub Actions language server feat: gh-actions-ls Jan 9, 2025
@disrupted disrupted changed the title feat: gh-actions-ls feat: gh-actions-language-server Jan 9, 2025
@disrupted disrupted force-pushed the feat/gh-actions-language-server branch from f13ecb9 to dd5f2f5 Compare January 9, 2025 14:15
@chrisgrieser
Copy link
Contributor

I just gave this one a try, and noticed that the config does not work initially, due to the usage of yaml.github as a filetype. While I get the idea to not start this language server on every yaml file, I do not think that the filetype yaml.github is automatically in nvim by default? I have to manually set them in my github action files, at least.

@disrupted
Copy link
Contributor Author

I just gave this one a try, and noticed that the config does not work initially, due to the usage of yaml.github as a filetype. While I get the idea to not start this language server on every yaml file, I do not think that the filetype yaml.github is automatically in nvim by default? I have to manually set them in my github action files, at least.

that's true. I recommend defining this pattern for GitHub workflows:

vim.filetype.add({
  pattern = {
    ['.*/%.github[%w/]+workflows[%w/]+.*%.ya?ml'] = 'yaml.github',
  },
})

We would either have to upstream this into Neovim core ftdetect or add a section to the docs

@justinmk
Copy link
Member

We would either have to upstream this into Neovim core ftdetect or add a section to the docs

The docs item in these configs is intended for that, it's definitely worth mentioning there.

default_config = {
cmd = { 'gh-actions-language-server', '--stdio' },
filetypes = { 'yaml.github' },
root_dir = util.root_pattern('.github'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that root_dir can be a function, so it could inspect the contents of every .yaml file to decide if it's a GH workflow.

I'll leave that as a followup for now.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's a standard way to identify GitHub YAML anyway. I mean, there are some specifics like inputs, maybe? But they're optional - there's also the slight difference between Workflow & Action so detecting this wouldn't be reliable anyway I think.

@justinmk justinmk merged commit 4c5748b into neovim:master Jan 13, 2025
11 checks passed
@disrupted disrupted deleted the feat/gh-actions-language-server branch January 13, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Github Actions Language Server
4 participants